﻿CREATE PROCEDURE dbo.UpdateMailSortSettingForMediaDefinition
	@MediaDefinitionId INT,
	@MailSortSettingId INT
AS

UPDATE i SET i.MailSortSettingId = @MailSortSettingId
FROM IndexDefinition i
INNER JOIN MediaDefinition m ON i.IndexDefinitionID = m.IndexDefinitionID
WHERE m.MediaDefId = @MediaDefinitionId